home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15265 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  952 b 

  1. Path: geraldo.cc.utexas.edu!usenet
  2. From: Sundeep Agrawal <sundeep@psy.utexas.edu>
  3. Newsgroups: comp.lang.c++
  4. Subject: (no subject)
  5. Date: 4 Apr 1996 15:39:01 GMT
  6. Organization: student
  7. Message-ID: <4k0qel$h7n@geraldo.cc.utexas.edu>
  8. NNTP-Posting-Host: pcf75.psy.utexas.edu
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 1.1N (Macintosh; I; PPC)
  13. X-URL: news:comp.lang.c++
  14.  
  15. say i declare something like given below where Cell is a class
  16.     
  17.  
  18.        Cell*** cpy1 = new Cell** [r];
  19.        Cell** cpy2 = new Cell * [r*c];
  20.  
  21.        for( int i=0;i<c;i++)
  22.         cpy1[i] = & cpy2[i*c];
  23.  
  24. basically I am creating a 2 dimensional array
  25.  
  26. where r = no of rows and c= no of cols
  27.  
  28. also I have same as the above like cpy1 I have a and like cpy2 I have b
  29.  
  30. Can I do something like this 
  31.  
  32.          *(cpy1[i][j])=*(a[i][j]);
  33.  
  34.  
  35. is this dereferencing the pointer at cpy[i][j] or is there some other 
  36. way ???
  37.  
  38.  
  39.  
  40.  
  41.  
  42.